#include "game.h"
#include "main.h"

Game::Game(quint64 GameId, quint16 GameMode, quint8 MaxPlayers, quint8 MaxLvl,
           quint8 MinLvl, QString GameDes, QString GameName, quint32 GameOnwer, QObject *parent) :
    QObject(parent), _GameMode(GameMode), _MaxPlayers(MaxPlayers), _MaxLvl(MaxLvl), _MinLvl(MinLvl),
    _GameDes(GameDes), _GameId(GameId), _GameName(GameName), _GameOnwer(GameOnwer), _canJoin(false),
    _unkByte(0)
{
    _Players.append(GameOnwer);
    _GInfo=(pk_GameInfo*)qMalloc(sizeof(pk_GameInfo));
    qMemSet(_GInfo,0,sizeof(pk_GameInfo));
    LPlayers[GameOnwer]->setGame(this);
}

Game::~Game()
{
    qFree(_GInfo);
}
